/*
 *  DropdownList.h
 *  Fridge
 *
 *  Created by Jeremy Abel on 7/1/12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */

#pragma once

#include "Widget.h"
#include "Panel.h"
#include "Button.h"
#include "../TypedList.h"
#include "../Preset/ExposedVariable.h"

class DialogPanel;
class DD_ListEntry;

class DropdownList : public Button
{
	public:
		
		DropdownList( Widget* pxParent );
		virtual ~DropdownList();
	
		virtual void Render();
		virtual void Update();
	
		virtual void AddListItem( const char* szName, ButtonPressCallback pfnCallback, void* pUserData );
	
	protected:
			
		static void DropdownTitleClickCallback( void* pData );
		static void DropdownItemClickCallback( void* pData );

		void CloseOpenList();
		bool CanGetFocus() { return false; }
	
		const char* szSelectedEntryName;
	
		bool m_bCloseOpenListNextFrame;
		TypedList< DD_ListEntry >* m_pxDropdownEntries;
	
		static DialogPanel* s_pxOpenDropdown;
};

//eof
